<!DOCTYPE HTML>
<html>
<head>
<title>菜单</title>
<link href="/static/web/css/bootstrap.css" rel="stylesheet" type="text/css" media="all">
<link href="/static/web/css/style.css" rel="stylesheet" type="text/css" media="all" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Spicemystery Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Libre+Baskerville:400,700' rel='stylesheet' type='text/css'>
<script src="/static/web/js/jquery.min.js"></script>
<link rel="stylesheet" href="/static/web/css/flexslider.css" type="text/css" media="screen" />
<script src="/static/web/js/simpleCart.min.js"> </script>		
{{css href="/static/web/css/styles.css"}}

</head>
<body>
<!-- header -->
<div class="head-top">
    <button class="history" style="background-clip: #5FA022">返回</button>
        </div>
    <div class="header">
		<div class="container">
			<div class="logo">
				<a href="index.html"><img src="/static/web/img/logo.png" class="img-responsive" alt=""></a>
			</div>
			<div class="header-left">
				<div class="head-nav">
					<span class="menu"> </span>
						<ul>
							<li><a href="index.html">1</a></li>
							<li><a href=" resturants.html">2</a></li>
							<li><a href="login.html">3 In</a></li>
							<li><a href=" contact.html">4</a></li>
								<div class="clearfix"> </div>
						</ul>
								<!-- script-for-nav -->
							<script>
								$( "span.menu" ).click(function() {
								  $( ".head-nav ul" ).slideToggle(300, function() {
									// Animation complete.
								  });
								});
							</script>
						<!-- script-for-nav --> 
					</div>
					<div class="header-right1">
						<div class="cart box_1">
							<a href="/cart">
								<h3> <span class="simpleCart_total">$0.00</span> (<span id="simpleCart_quantity" class="simpleCart_quantity">0</span>)</h3>
							</a>	
							<p>
								<a href="#" class="simpleCart_empty">
									<button class="delcart" del-id="000">清除购物</button>
								</a>
							</p>
							<div class="clearfix"> </div>
						</div>
					</div>
					<div class="clearfix"> </div>
				</div>
					<div class="clearfix"> </div>
			</div>
	</div>
<!-- header -->
<!-- about -->
<div class="orders">
	<div class="container">
	<h4 style="width: 50%;float: left;">菜品</h4><h4>价格</h4>
		{{volist name="res" id="v"}}
		<div class="order-top">
			<li class="data">
				<p>{{$v['name']}}</p>
			</li>
			<li class="data">
				<div class="special-info grid_1 simpleCart_shelfItem">
					
					<div class="pre-top">
						<div class="pr-left">
							<div class="item_add">
								<span class="item_price">
									<h6>{{$v['price']}}</h6>
								</span>
							</div>
						</div>
						<div class="pr-right">
							<div class="item_add"><span class="item_price"><a href="#"><button style="width: 100px" class="add_btn" data-id="{{$v['id']}}">加入购物车</button></a></span></div>
						</div>
							<div class="clearfix"></div>
					</div>
					</div>
				</li>
			<div class="clearfix"></div>
		</div>
		{{/volist}}

	</div>
</div>
<!-- about -->	
 <div class="primary-mobile">
  <ul class="flex justify-around logging-in-element">
    
    <li class="home" id="home-mobile">
      <a href="/app" class="active">
        <span class="icons">
          <img src="/static/web/img/icon-home.svg">
          <img src="/static/web/img/icon-home-active.svg" class="active">
        </span>
        <div id="home-mobile">主页</div>
      </a>
    </li>
    
    <li class="stores" id="stores-mobile">
      <a href="/store">
        <span class="icons">
          <img src="/static/web/img/icon-stores.svg">
          <img src="/static/web/img/icon-stores-active.svg" class="active">
        </span>
        <div id="stores-mobile">门店</div>
      </a>
    </li>
    
    <li class="account" id="account-mobile">
      <a href="/account">
        <span class="icons">
          <img src="/static/web/img/icon-account.svg">
          <img src="/static/web/img/icon-account-active.svg" class="active">
        </span>
        <div id="account-mobile"><span data-reactroot="" class="">我的帐户</span></div>
      </a>
    </li>
    
    <li class="menu" id="menu-mobile">
      <a href="/menu">
        <span class="icons">
          <img src="/static/web/img/icon-menu.svg">
          <img src="/static/web/img/icon-menu-active.svg" class="active">
        </span>
        <div id="menu-mobile">菜单</div>
      </a>
    </li>
    
    <li class="more" id="more-mobile">
      <a class="icon trigger" rel="nav-overlay">
        <span class="icons">
          <img src="/static/web/img/icon-more.svg">
          <img src="/static/web/img/icon-more-active.svg" class="active">
        </span>
        <div>更多</div>
      </a>
    </li>
  </ul>
</div>
<!-- footer-->	
</body>
</html>


<script>
	$(function () {
        $('.add_btn').click(function () {
            var ac_id = $(this).attr('data-id');
            addAjax(ac_id);
        });
    });


	function addAjax(id) {
        $.ajax({
            type: 'get',
            url: '/carts/' + id,
            dataType: 'json',
            success: function (data) {
                console.log('成功');
            },
            error: function () {
                console.log('失败');
            }
        });
    }
</script>

<script>
    $(function () {
        $('.delcart').click(function () {
            var av_id = $(this).attr('del-id');
            delAjax(av_id);
        });
    });


	function delAjax(id) {
        $.ajax({
            type: 'get',
            url: '/delcart/' + id,
            dataType: 'json',
            success: function (data) {
                console.log('成功');
            },
            error: function () {
                console.log('失败');
            }
        });
    }


      $(".history").on("click",function(){
　　      window.history.go(-1);
      })
</script>